home *** CD-ROM | disk | FTP | other *** search
/ AOL File Library: 4,101 to 4,200 / aol-file-protocol-4400-4101-to-4200.zip / AOLDLs / ADV - Articles & Misc / Manual for ProDev DDT8_DDT16 / DDT.MANUAL.bxy / DDT.Manual / CHAPTER.4 (.txt) < prev    next >
AppleWorks Document  |  1993-08-05  |  14KB  |  246 lines

  1. O=====<====<====<====<====<====<====<====<====<====<====<====<====<====<====<===
  2. O=====<====<====<====<====<====<====<====<====<====<====<====<====<====<====<===
  3. card as bank 1.the ProDev DDT displays the lowest bank
  4. CHAPTER 4
  5. BREAK POINTS
  6. SB [T A.N] - SET BREAK POINT
  7. JBreak points work like stop signs in the target program. By strategically L
  8. Jplacing break points you can determine many things about the logical flow E
  9. Ca program follows. Break points must be placed at EXACTLY the same J
  10. Haddress as the first byte of the instruction where you want the program &
  11. to stop. (see the following example)
  12. TYPES OF BREAKS
  13. BThe ProDev DDT has two types of software break points, "Real" and K
  14. I"Implied". There is also a hardware break point, "Hard Break", that will 
  15. be described later.
  16. DA Real break inserts "BRK" (break, HEX 00) commands in place of any $
  17. instruction that is in RAM memory.
  18. DThe Implied break does not modify your program. This allows Implied L
  19. Jbreaks to be used in ROM locations or write protected RAM. Implied breaks K
  20. Iare ONLY affective when STepping, TRacing or EXecuting code and will not /
  21. stop a program if it is running in real time.
  22.    The form of the Set Break instruction is:
  23.    SB [ Type  Address . Number ]
  24. IWhere Type is input as "R" for Real break or "I" for Implied break. Type )
  25. "R" is assumed if no Type is indicated.
  26. EAddress is any Hex number or decimal equivalent. Bank numbers may be 0
  27. specified and must be followed by a "/" slash.
  28. INumber is any Hex or decimal number in the range of $0001 to $FFFF. This I
  29. Gis the number of times to pass this breakpoint before stopping program I
  30. Gexecution. Entering $0000 will result in passing the breakpoint 65,536 J
  31. Htimes. Therefore, the actual range is 1 to 65,536 or $0001 to $0000 but L
  32. Jthat looks weird. If no value is input for Number then the default of "1" 
  33. will be assumed.
  34. ?If you specify a break where one already exists, the new break #
  35. information will replace the old.
  36. JEntering "SB<cr>" will provide a list of the current SOFT BREAKS, if any. H
  37. FThe break points are listed in the order last accessed, with the most I
  38. Grecent being at the top left of the display. This command is primarily I
  39. Gintended for use with a serial terminal but is also useful if you have G
  40. entered more breakpoints than can be displayed in the "Break Window".
  41. EA maximum of 50 breakpoints is allowed at any one time. The ten most K
  42. Irecently accessed breakpoints are displayed in the "Break Window" of the #
  43. ProDev DDT's main display screen.
  44.    EXAMPLE 
  45. SB I 800.1
  46. G   Sets an Implied break at location $800 in the current bank and will (
  47. stop the first time it is encountered.
  48. SB R 1/0900.3
  49. F   Sets a Real break at location $900 in bank 1 {DDT8 aux memory} and -
  50. will stop the third time it is encountered.
  51. SB R 03/2345.!200
  52. G   Sets a Real break at location $2345 in bank
  53. 3 {DDT8 aux memory} and )
  54. will stop after decimal 200 encounters.
  55. SB 2003
  56. I   Sets a Real break at location $2003 in the current bank and will stop #
  57. the first time it is encountered.
  58. EXAMPLE
  59. Stop the program below when the "JMP 3000" instruction is reached.
  60. 00/2000: A9 A0          LDA  #A0#
  61. 00/2002: 20 ED FD       JSR  FDED#
  62. 00/2005: 4C 00 30       JMP  3000
  63. FWe will use a Real Type breakpoint so the program will be interrupted E
  64. Cfrom running in real time. We also want to stop the first time the E
  65. breakpoint is encountered. The following will place the breakpoint:
  66. :SB R 0/2005.1
  67. :SB 2005
  68.  { assumes bank 0 is current default
  69. The new breakpoint should appear in Window #4, the Break Window.
  70. {Now run the program.}
  71. :GO 2000
  72.         { start running program in real time
  73. IWhen the Breakpoint is reached the program is halted and the processor's ,
  74. registers are displayed as follows {DDT8}.
  75. BREAKPOINTA
  76. A=A0 X=00 Y=FF S=FB M=0A L=0 P=N-1-----
  77.   { registers may vary 
  78. 00/2005:4C 00 30    JMP 3000
  79. ENote! The word "BREAKPOINT" was displayed, indicating the ProDev DDT 2
  80. stopped the program execution with a Breakpoint.
  81. ***** HOW IT WORKS *****
  82. JWhen you enter a Breakpoint, the ProDev DDT saves the current instruction J
  83. Hto its own internal memory and replaces the instruction byte with a BRK L
  84. Jcommand (HEX 00). Then it waits for a BRK command to be executed. When it K
  85. Isees one, it checks to see if it is a break that you have entered. If it L
  86. is, the ProDev DDT stops the program and gives you control. However, when 
  87. Git displays the instruction, it displays the original instruction byte >
  88. and not the BRK command which really occupies that location.
  89. CWhen the "GO" command is used to run a program and a Real Break is H
  90. Fencountered, the program is stopped, the DISPLAY REGISTERS command is K
  91. Iautomatically executed, and you are returned to the ProDev DDT's command 
  92. level.
  93. ***** MOVING CODE & BREAKPOINTS *****
  94. HCaution!!! If a section of code containing Real Breaks is relocated the H
  95. FProDev DDT will not recognize the Breaks and undesirable results will 
  96. occur.
  97. HIf part of a program containing Real Breaks is overwritten by new code, K
  98. Ithe ProDev DDT will not know about it. If you then proceed to remove the K
  99. IReal Breaks the existing code will be overwritten by the contents of the 
  100. original breakpoint location.
  101. CONDITIONAL BREAKPOINTS
  102.  {DDT16}
  103. EConditional breakpoints extend the function of normal breakpoints by I
  104. Gallowing you to use the contents of the processor's registers as break 3
  105. conditions. The command takes the following form:
  106. SB C $01/2345 , X = $6789 
  107.         ^  ^^^^^^^   ^ ^  ^^^^E
  108.         |_____|______|_|___|____ Indicates a conditional breakpoint8
  109.               |______|_|___|____ Address of breakpoint:
  110.                      |_|___|____ Register for comparison3
  111.                        |___|____ Logical operator?
  112.                            |____ Value to compare to register
  113. IThis example would cause a break at location $01/2345 if the contents of &
  114. the "X" register was equal to $6789.
  115. The registers that may be used for comparison are:
  116. A,X,Y,S,D,B,M,Q and P.
  117. The allowable logical operators are:
  118. less than"
  119. greater than
  120. equal
  121. not equal(
  122. less than OR equal+
  123. greater than OR equal
  124. IAll comparisons are done in full 16 bit native mode. 8 bit registers are 2
  125. compared to the low byte of the comparison word.
  126. DConditional breakpoints modify the target program the same way Real J
  127. breakpoints do and therefore they may not be used in ROM code locations.
  128. HThe purpose for adding this feature was to allow breaking on particular G
  129. Etool calls. Tool calls are made by placing a two-byte value in the X I
  130. Gregister that identifies the tool set and the command value to use and K
  131. Ithen doing a JSL to the common tool entry point at $E1/0000. To break on I
  132. Ga particular tool call we simply determine the value of the X register K
  133. Ithat corresponds to the desired tool to break on and place a conditional K
  134. Ibreak point at location $E1/0000. The following statement would break on 
  135. a TLShutDown tool call:
  136. SB C $E1/0000,X=0301
  137. RB A - REMOVE BREAK
  138. EThe REMOVE BREAK command allows you to remove any of the Breakpoints H
  139. Fwhich you have entered. The address is mandatory, as indicated by the J
  140. Hfact that the letter "A" is not enclosed in brackets. When you remove a K
  141. IBreakpoint the original instruction is fully restored and the address is '
  142. removed from the list of Breakpoints.
  143. EXAMPLE
  144. Remove the Breakpoint from address $2005
  145. :RB 0/2005
  146.   or  
  147. :RB 2005
  148. HB [A] - HARD BREAK
  149. JThe HARD BREAK command appears very similar to the Set Break command. The I
  150. Gcommand actually activates the one hardware Stop-On-Address the ProDev G
  151. EDDT is equipped with. Omitting the optional address will result in a L
  152. Jdisplay of the current HARD BREAK address. When activated, the ProDev DDT K
  153. Iwatches the addresses that are being accessed by the processor. It stops G
  154. the target program when it sees the specified address being accessed.
  155. FThe Hardware Break may be used as a real time breakpoint for programs I
  156. Gthat are running from read only memory (ROM). This command may also be F
  157. Dused to monitor any memory location and stop your program when that K
  158. Ilocation is accessed. For example, if a certain memory location is being G
  159. Emodified and you wish to find out which instructions are causing the J
  160. Hmodification, you simply use the HARD BREAK command to stop the program '
  161. when the memory location is accessed.
  162. JThe bank address specified in the Hard Break address is not actually used L
  163. Jin the DDT's hardware comparator. This is because the DDT's comparator is K
  164. Ionly able to compare 16 bits at once. The comparison of the bank address F
  165. Dis done in software by looking at the target programs 'program' and L
  166. J'bank' registers. If no match is found the Hard Break is ignored. You can I
  167. Gtell the DDT to ignore bank addresses when doing a Hard Break by using 
  168. the HBX command:
  169. HBX address
  170. GThis will place a Hard Break at the specified address and will stop in G
  171. all banks, not just the current program or data bank. The command is 
  172. Duseful if your program is being stepped on and you want to find the I
  173. Goffending instruction. The normal Hard Break would usually work unless I
  174. Gthe offending instruction is a 'long indirect' addressing type such as I
  175. GSTA [aa]. In this case the destination bank address is not the current D
  176. Bprogram or data bank and the normal Hard Break would not stop the 
  177. program.
  178. BIf you enter the command correctly the Breakpoint display will be #
  179. address instead of HB address.
  180. EXAMPLE   Used as a real time ROM breakpoint.
  181. JLet's assume the following program resides in ROM and you wish to place a )
  182. real time breakpoint at location $FDB5.
  183. 00/FDB3  A5 3C    LDA 3C
  184. 00/FDB5  09 07    ORA #07
  185. 00/FDB7  85 3E    STA 3E
  186. Place the Hard Break with the following command:
  187. :HB 0/FDB5
  188. JThe Break Window should display the new Hard Break location in the top of 
  189. the window as "H00/FDB5".
  190. HNow if you run the program the Hard Break will interrupt execution when 2
  191. $FDB5 is reached and will display the following.
  192. HARD BREAK@
  193. A=07 X=00 Y=00 S=F4 M=0A L=0 P=--1B----
  194.   { contents may vary
  195. 00/FDB7:85 3E       STA 3E
  196. HNote! The address displayed is $FDB7 and not $FDB5 where you placed the D
  197. BHard Break. This assumes you started the program running prior to K
  198. Ilocation $FDB3. This is normal operation. One or two addresses following F
  199. Dthe selected Break location is displayed because of the way the CPU 
  200. handles interrupts.
  201. ***** ADVANCED EXPLANATION *****
  202. EWhen the ProDev DDT sees the address $FDB5 it sends the processor an J
  203. Hinterrupt. However, the processor does not stop program execution until L
  204. Jit has finished the instruction that it is currently working on. Which in B
  205. @this case is "ORA #$07". The processor completes the "ORA #$07" I
  206. Ginstruction and then gives control over to the ProDev DDT which is why L
  207. Jthe address displayed by a HARD BREAK is the instruction or two following "
  208. the actual address of the BREAK.
  209. EXAMPLE   memory location being changed
  210. GMemory location $21 is being changed when you run your program and you G
  211. Ewish to know which instructions are responsible. Simply use the HARD 
  212. BREAK feature as follows:
  213. :HBX 0/21 or :HBX 21
  214. IWhen you run your program and location $21 is accessed your program will K
  215. Ibe stopped at the instructions following the one which accessed location I
  216. G$21. If you wish to check for any other instructions which also access G
  217. Elocation $21, simply enter the "GO" command to continue running your H
  218. Fprogram. If any other instructions access location $21 they will also +
  219. cause the HARD BREAK to stop the program.
  220. RH - REMOVE HARD BREAK
  221. DThe REMOVE HARD BREAK command allows you to remove the current HARD H
  222. BREAK. An address is not required, since there is only one HARD BREAK.
  223. RA - REMOVE ALL BREAKS
  224. EThe REMOVE ALL BREAKS command allows you to remove all existing SOFT 1
  225. BREAKS and the one HARD BREAK with one command.
  226. EXAMPLE
  227. To remove all existing BREAKS simply enter the following:
  228. The BUTTON INTERRUPT
  229. JThe BUTTON INTERRUPT gives you access to the NMI (non-maskable interrupt) I
  230. Gline through the ProDev DDT card. This allows you to regain control of I
  231. Gprograms that are running in real time or of programs that are running J
  232. Hout of control. The BUTTON INTERRUPT will not work until the ProDev DDT 8
  233. card has been initialized following a system power up.
  234. IThe hardware on the DDT card generates an NMI to interrupt the currently 
  235. running program.
  236. {DDT16}J
  237. HThe DDT uses the NMI vector at $03FB to redirect program control to the K
  238. IDDT. This vector is set when you initialize the DDT. If this vector gets J
  239. Hchanged after the DDT has initialized it, the button interrupt will not G
  240. Eget vectored to the DDT and will cause bad things to happen. Booting K
  241. IProDOS 8 is one way to change the $03FB vector. Always try to initialize 7
  242. the DDT just prior to using it to avoid this problem.
  243. {DDT8}L
  244. JThe DDT uses hardware to disable the Apple //e's ROMs and take control of G
  245. the NMI handler. It is possible to interrupt any program at any time.
  246.